import {combineReducers, createStore} from 'redux';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import userReducer from "./user/reducer";
import configReducer from "./config/reducer";

const allReducer = combineReducers({
    user: userReducer,
    config: configReducer
})

const persistConfig = {
    key: 'oss',
    storage,
}

export const store = createStore(persistReducer(persistConfig, allReducer));

// @ts-ignore
export const persist = persistStore(store)

export type RootState = ReturnType<typeof store.getState>




